home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3408 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  813 b 

  1. Path: dsm6.dsmnet.com!NewsWatcher!user
  2. From: tfiedler@muscanet.com (Todd A. Fiedler)
  3. Newsgroups: comp.lang.c
  4. Subject: Clearing the keyboard buffer in ANSI C
  5. Date: 28 Jan 1996 19:39:50 GMT
  6. Organization: Des Moines Internet
  7. Message-ID: <tfiedler-2801961347210001@205.217.163.224>
  8. NNTP-Posting-Host: 205.217.163.224
  9.  
  10. Help.
  11.  
  12. I am a newbie to C and I can't figure out how to clear the keyboard buffer.
  13.  
  14. I am writing a program that runs from the console and asks for user input.
  15. Anyway, I cannot seem to get the last newline character out of the stream
  16. before my next fscanf or fgets. I have tried fflush() to no avail. I have
  17. even tried placing "%*s" in my fscanf string to capture the errant
  18. newline. Still
  19. won't work.
  20.  
  21. Any suggestions, help or comments would be *greatly* appreciated.
  22.  
  23. Thanks
  24.  
  25. tfiedler@muscanet.com
  26.